def listSum(alist):
    # 递归出口
    if len(alist) == 1:
        return alist[0]
    else:
        # 以更小的规模调用自己
        return alist[0] + listSum(alist[1:])


print(listSum([1,2,3]))